package com.heima.user.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.FollwDto;
import com.heima.user.service.ApUserFanService;
import com.heima.user.service.ApUserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/user")
public class ApUserFollowController {
    @Autowired
    ApUserFollowService apUserFollowService;

    @Autowired
    ApUserFanService apUserFanService;

    /**
     * 关注
     * @param dto
     * @return
     */

    @PostMapping("/user_follow")
    public ResponseResult UserFollow(@RequestBody FollwDto dto){

        return  apUserFollowService.follow(dto);
    }

    /**
     * 数据回显——关注
     */
    @PostMapping("/{userId}/{followId}")
    public Boolean isFollow(@PathVariable("userId") int userId, @PathVariable("followId") int followId){
        return apUserFollowService.isFollow(userId,followId);
    }
}
